	function getXMLHttpRequest() {    
		var xmlHttp;    
		try {    
			// Firefox, Opera 8.0+, Safari    
			xmlHttp = new XMLHttpRequest();    
		}    
		catch (e) {    
			// Internet Explorer    
			try {    
				//Internet Explorer 6.0+    
				xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");    
			}    
			catch (e) {    
				try {    
					//Internet Explorer 5.5+    
					xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");    
				}    
				catch (e) {    
					alert("您的浏览器不支持AJAX！");    
					xmlHttp = null;    
				}    
			}    
		}    
		return xmlHttp;    
	}
	
	function doAjax(url, params, callback) {
		var req = getXMLHttpRequest();

		if (req != null) {
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					if (200 == req.status) {
						callback(req.responseText);
					} else if (404 == req.status) {
						alert('404 - HTTP请求路径操作');
					} else if (500 == req.status) {
						alert('500 - 服务器端内部错误');
					}
				}
			}
		}
		req.open("POST", url, true);
		req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8");
		req.send(params);
	}
	
	/*
	window.alert = function(str) 
	{ 
		var top = document.body.scrollTop || document.documentElement.scrollTop;
        var isIe = (document.all) ? true : false;
        var isIE6 = isIe && !window.XMLHttpRequest;
        var sTop = document.documentElement.scrollTop || document.body.scrollTop;
        var sLeft = document.documentElement.scrollLeft || document.body.scrollLeft;
        var winSize = function(){
            var xScroll, yScroll, windowWidth, windowHeight, pageWidth, pageHeight;
            // innerHeight获取的是可视窗口的高度，IE不支持此属性
            if (window.innerHeight && window.scrollMaxY) {
                xScroll = document.body.scrollWidth;
                yScroll = window.innerHeight + window.scrollMaxY;
            } else if (document.body.scrollHeight > document.body.offsetHeight) { // all but Explorer Mac
                xScroll = document.body.scrollWidth;
                yScroll = document.body.scrollHeight;
            } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
                xScroll = document.body.offsetWidth;
                yScroll = document.body.offsetHeight;
            }

            if (self.innerHeight) {    // all except Explorer
                windowWidth = self.innerWidth;
                windowHeight = self.innerHeight;
            } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
                windowWidth = document.documentElement.clientWidth;
                windowHeight = document.documentElement.clientHeight;
            } else if (document.body) { // other Explorers
                windowWidth = document.body.clientWidth;
                windowHeight = document.body.clientHeight;
            }

            // for small pages with total height less then height of the viewport
            if (yScroll < windowHeight) {
                pageHeight = windowHeight;
            } else {
                pageHeight = yScroll;
            }

            // for small pages with total width less then width of the viewport
            if (xScroll < windowWidth) {
                pageWidth = windowWidth;
            } else {
                pageWidth = xScroll;
            }

            return{
                'pageWidth':pageWidth,
                'pageHeight':pageHeight,
                'windowWidth':windowWidth,
                'windowHeight':windowHeight
            }
        }();
        var shield = document.createElement("DIV"); 
        shield.id = "shield"; 
        shield.style.position = "absolute"; 
        shield.style.left = "0px"; 
        shield.style.top = "0px"; 
        shield.style.width = "100%"; 
        shield.style.height = document.body.scrollHeight+"px"; 
        //弹出对话框时的背景颜色 
        shield.style.textAlign = "center"; 
        shield.style.zIndex = "25"; 
        //背景透明 IE有效 
		var styleStr = 'display:block;position:fixed;_position:absolute;left:' + (winSize.windowWidth / 2 - 200) + 'px;top:' + (winSize.windowHeight / 2 - 150) + 'px;_top:' + (winSize.windowHeight / 2 + top - 150)+ 'px;'; //弹出框的位置
	    var alertFram = document.createElement("DIV"); 
	    alertFram.id="alertFram";
	    alertFram.style.cssText = styleStr;
	    alertFram.style.width = "350px"; 
	    alertFram.style.height = "150px"; 
	    alertFram.style.background = "#ff0000"; 
	    alertFram.style.textAlign = "center"; 
	    alertFram.style.lineHeight = "150px"; 
	    alertFram.style.zIndex = "300";       
	    strHtml = "<ul style=\"list-style:none;margin:0px;padding:0px;width:100%\">\n"; 
	    strHtml += " <li style=\"background:#1c7a86;text-align:left;padding-left:20px;font-size:14px;font-weight:bold;color:#fcffff;height:30px;line-height:30px;border:1px solid #186c7f;\">中国药科大学二手书交易平台</li>\n"; 
	    strHtml += " <li style=\"background:#fff;text-align:center;font-size:16px;height:120px;line-height:120px;border-left:1px solid #186c7f;border-right:1px solid #186c7f;\">"+str+"</li>\n"; 
	    strHtml += " <li style=\"background:#2aaca1;text-align:center;font-weight:bold;height:30px;line-height:30px; border:1px solid #186c7f;\"><input type=\"button\" value=\"确 定\" onclick=\"doOk()\" /></li>\n"; 
	    strHtml += "</ul>\n"; 
	    alertFram.innerHTML = strHtml; 
	    document.body.appendChild(alertFram); 
	    document.body.appendChild(shield);
	    var ad = setInterval("doAlpha()",5); 
	    
	    this.doOk = function()
	    { 
	    	document.body.removeChild(alertFram);
	    	document.body.removeChild(shield);
	    } 
	    alertFram.focus(); 
	  document.body.onselectstart = function(){return false;}; 
	} 
	*/
	